﻿using PetaPoco;
using PmSoft.ApplicationContext;
using PmSoft.Events;
using PmSoft.Logging;

namespace PmSoft.Repositories;

public class EntityEventArgs : CommonEventArgs
{
    public EntityEventArgs(IApplicationContext applicationContext) : base(applicationContext, "EntityOperation") { }

    public EntityEventArgs(IApplicationContext applicationContext, IDatabase database, IEntity entity, EntityOperationType operationType) : base(applicationContext, "EntityOperation")
    {
        DatabaseName = database.GetType().Name;
        Entity = entity;
        OperationType = operationType;
    }

    public string DatabaseName { get; set; }
    public IEntity Entity { get; set; }
    public EntityOperationType OperationType { get; set; }
}
